package com.bwie.test;

/**
 * description:
 *
 * @Author caoshuaifeng
 * @Create 2025/4/25 19:52
 * @Version 1.0
 */
public class ThreadDemo2 {
    public static void main(String[] args) {
        /**
         * 定义一个类实现Runnable接口
         * 重写run方法
         * 创建自己类对象，调用start方法
         * 创建线程对象
         */
        MyRunnable s1 = new MyRunnable();
        Thread x1 = new Thread(s1);
        Thread x2 = new Thread(s1);

        x1.setName("线程1");
        x2.setName("线程2");

        x1.start();
        x2.start();


    }
}
